//@ts-check
// // import './css/reset.css';
import {
    icon,
    Mask,
    popup,
    popover
} from './others';

import {
    Toast,
    msgbox
} from './notice';

import {
    form,
    formItem,
    input,
    inputdate,
    checkbox,
    radio,
    select,
    option,
    datepicker,
    day
} from './form';

import {button,buttonIcon} from "./basic/button"
// import popup from "./others/popup/index.js"

// @ts-ignore
var daddyVue = Vue;
if (!daddyVue) {
    throw new Error('rx.view 初始化失败：没有找到Daddy Vue。')
}
var _vueProto = daddyVue.prototype;
/**
 * 注册自定指令
 */
import drag from './directive/drag.js';
import tips from './directive/tips.js';
daddyVue.directive('drag', drag);
daddyVue.directive('tips', tips);
//
_vueProto.$rxConstructor = {
    Toast,
    Mask
};

_vueProto.$rxAlert=msgbox.alert
_vueProto.$rxConfirm=msgbox.confirm
_vueProto.$rxMsgbox=msgbox.msgbox
// _vueProto.$rxMsgBox=new Mask({popups:{msgbox}}).show;;

// console.log(popup)
// _vueProto.$rxPopup=new _vueProto.$rxConstructor.Mask({popups:popup}); 
// console.log(_vueProto.$rxPopup)
// import scrollx from './basic/scrollx.vue';
// //
// import table from './data/table/table.vue';
// // 收缩型表格
// import resizetable from './data/table/resizetable.vue';
// //固定列的表格
// import fiexdColumnTable from './data/table/fiexdColumnTable.vue';
// import popover from './others/popover.vue';
// //树形结构
// import tree from './data/tree/tree.vue';
// import treeItem from './data/tree/treeItem.vue';

// import checkbox from './form/checkbox.vue';
// import radio from './form/radio.vue';
// import select from './form/select.vue';
// import inputdate from './form/inputdate.vue';
// import search from './form/search.vue'

// import pagination from './pagination/pagination';
// import input from './form/input';
// import selectrx from './form/selectrx';
// import selectinput from './form/selectinput';
// import datepickerrx from './datepicker/datepickerrx';
// import datepickerser from './datepicker/datepickerser';
// import paginationpopup from './pagination/paginationpopup'

// //样式
// // import './index.css'

var components = {
    //     scrollx,
    //     checkbox,
    //     radio,
    //     popover,
    //     select,
    //     inputdate,
    form,
    'form-item':formItem,
    icon,
    popup,
    popover,
    select,
    option,
    input,
    inputdate,
    checkbox,
    radio,
    button,
    'button-icon':buttonIcon,
    datepicker,
    day
    //     table,
    //     resizetable,
    //     tree,
    //     'fiexd-column-table': fiexdColumnTable,
    //     'tree-item': treeItem,
    //     search,
    //     pagination,
    //     input,
    //     selectrx,
    //     selectinput,
    //     datepickerrx,
    //     datepickerser,
    //     paginationpopup
}


var prefix = 'rx-';
Object.keys(components).forEach(name => {
    daddyVue.component(prefix + name, components[name]);
});

// import maskfn from './others/dialog/mask.js'
// // import alert from './dialog/dialog.js'
// import { Alert, Confirm, Msgbox } from './notice/alert';
// import Toast from './notice/toast';
// import Fixed from './others/fixed';
// import PickDate from './form/datepicker'


// _vueProto.$rxMask = maskfn;
// _vueProto.$rxAlert = Alert;
// _vueProto.$rxConfirm = Confirm;
// _vueProto.$rxMsgbox = Msgbox;
// _vueProto.$rxToast = Toast;
// _vueProto.$rxFixed = Fixed;
// _vueProto.$rxPickDate = PickDate;